package com.iflytek.iot.common.exception;


import com.iflytek.iot.common.constants.BaseErrorCode;
import com.iflytek.iot.common.constants.IMessage;

/**
 * 业务异常
 * <p>
 * 此异常去掉异常栈构造,减少开销
 * 将由全局异常处理做业务处理
 *
 * @author zurun
 * @date 2018/3/11 12:59:07
 */
public class BusinessException extends IflytekRuntimeException {


    public BusinessException(String errorCode, String errMsg) {
        super(errorCode, errMsg);
    }

    public BusinessException(String errMsg) {
        super(BaseErrorCode.common.UNKNOWN_ERROR.getErrCode(), errMsg);
    }

    public BusinessException(IMessage errCode) {
        super(errCode);
    }

    public BusinessException(IMessage errCode, String errMsg) {
        super(errCode, errMsg);
    }


    /**
     * 减少开销
     *
     * @return
     */
    @Override
    public Throwable fillInStackTrace() {
        return this;
    }


}
